package testLayer;

import static org.junit.Assert.*;
import java.util.Date;
import modelLayer.Invoice;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class InvoiceTest {
	
	private Date    date = new Date();
	private Invoice invoice; 
	
	@Before
	public void setUp() throws Exception {
		
		this.invoice = new Invoice(1234);
		
	}

	@After
	public void tearDown() throws Exception {
		
		
		
	}

	@Test
	public void testGetInvoiceSuccess() {
		
		assertEquals(1234, this.invoice.getInvoiceID());
		
	}
	
	@Test
	public void testGetInvoiceFails() {
		
		assertNotSame(4321, this.invoice.getInvoiceID());
		
	}
	
	@Test
	public void testSetInvoiceIDSuccess() {
		
		this.invoice.setInvoiceID(4321);
		assertEquals(4321, this.invoice.getInvoiceID());
		
	}
	
	@Test
	public void testSetInvoiceIDFails() {
		
		this.invoice.setInvoiceID(4321);
		assertNotSame(1234, this.invoice.getInvoiceID());
		
	}

	/**
	 * This test is simply to see if the payment date 
	 * is correctly set to be today
	 */
	@Test
	public void testGetPaymentDateSuccess() {
		
		assertEquals(this.date, this.invoice.getPaymentDate());
		
	}
	
}
